﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

/// <summary>
///Car 的摘要说明
/// </summary>
public class Car
{
    private int currSp;    //定义一个私有的整数类型变量
    private string petName;//定义一个私有的字符串类型变量
    public Car(){}         //默认构造函数
    public Car(string name, int speed)//定义一个参数类型的默认构造函数
    {
        petName = name;
        currSp = speed;
    }
    public override string ToString()//重写字符串类型的ToString方法
    {
        return string.Format("{0} 的速度可以达到 {1} MPH！",petName,currSp);
    }
}
